<template>
    <div>

      <h2>{{ $store.state.counter}}</h2>
      <button @click="add()"> 加法</button>
      <button @click="addAsync()"> Async加法</button>
    </div>
</template>

<script>
  export default {
    name: "storeDemo2",
    methods: {
      add(){
        this.$store.commit('increment')
      },
      addAsync(){

        this.$store.dispatch('incrementByAsync')
      }
    }
  }
</script>

<style scoped>

</style>
